#include "func_handler.h"
#include "start_ui.h"
bit is_btn_scan=0;//

void btn_click_tick(){
	#define BTN_SCAN_PERIOD		30   
	static idata u8 tick = 0;
	tick++;
	if(tick==BTN_SCAN_PERIOD)
	{
		tick = 0;
		is_btn_scan = 1;
	}
}

void btn_click_handler(){
	u16 btn_val=0;
	#define  BTN_VAL_ADDR		0x2000
	if(!is_btn_scan)return;
	is_btn_scan=0;
	sys_read_vp(BTN_VAL_ADDR,&btn_val,1);
	if(btn_val==0)return;
	start_ui_btn_click(btn_val);
	btn_val=0;
	sys_write_vp(BTN_VAL_ADDR,&btn_val,1);
	
}